home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROCS.ZIP
/
XROTATE.ICN
< prev
Wrap
Text File
|
1992-09-28
|
766b
|
35 lines
############################################################################
#
# File: xrotate.icn
#
# Subject: Procedure to rotate values in list or record
#
# Author: Ralph E. Griswold
#
# Date: April 26, 1992
#
###########################################################################
#
# xrotate(X, i) rotates the values in X right by one position. It works
# for lists and records.
#
# This procedure is mainly interesting as a recursive version of
#
# x1 :=: x2 :=: x3 :=: ... xn
#
# since a better method for lists is
#
# push(L, pull(L))
#
############################################################################
procedure rxotate(X, i)
/i := 1
X[i] :=: xrotate(X, i + 1)
return X[i]
end